#pragma once

#include "GrandiaX Mana Egg Table Generator Doc.h"


class CGrandiaXSpecialsView : public CScrollView
{
public: // create from serialization only
	CGrandiaXSpecialsView();
	DECLARE_DYNCREATE(CGrandiaXSpecialsView)

// Attributes
public:
	CGrandiaXManaEggTableGeneratorDoc* GetDocument();

// Operations
public:
    // Virtual Functions
    virtual const char* GetSectionName(int Section);
    virtual int GetSections() const;
    virtual void GetCommonInfo(SpecialCommonInfo* SCI, int Section, int Index);
    virtual void SetCommonInfo(SpecialCommonInfo* SCI, int Section, int Index);
    virtual const char* GetSectionName(int Section, int Index);
    virtual void WriteToGame();
    virtual void UpdateFullSection(int SectSel) {}

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CGrandiaXSpecialsView)
	public:
	virtual void OnDraw(CDC* pDC);  // overridden to draw this view
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
	virtual void OnInitialUpdate();

	protected:
	virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
	virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
	virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
	virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam);
	//}}AFX_VIRTUAL

// Implementation
public:
	virtual ~CGrandiaXSpecialsView();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

protected:

    CComboBox Section;

    CStatic MainTitle[9];

    CStatic TitleStatus[16];
    CStatic TitleStates[5];

    CStatic Special[5];

    CEdit SP[5];
    CComboBox Element[5];
    CComboBox Selection[5];
    CComboBox Target[5];
    CComboBox Area[5];
    CComboBox Function[5];

    CStatic LevelPropTitle[5][3];
    CEdit LevelPropData[5][3][7];

    CStatic LevelUpTitle[5];
    CEdit LevelUpData[5][6];

    CStatic ActIndicator[5][4];

    CComboBox SpecialFunction[5][4];
    CEdit KnockBack[5][4];

    CButton Status[5][4][16];
    CButton States[5][4][5];

    CStatic LevelActPropTitle[5][5][4];
    CEdit LevelActPropData[5][5][4][7];

    CStatic MoveLevelUpTitle[5];

    CComboBox MoveLevelUpRefMove[5][2];
    CComboBox MoveLevelUpRefMoveLevel[5][2];

  // Generated message map functions
protected:

    int IsShiftPressing;
    int IsControlPressing;

    CToolTipCtrlEx m_tip;

    void EnsureStateDuration(int Spc, int Act, int MinDur, int MaxDur);
    void EnsureStatusRate(int Spc, int Act, int MinRate, int MaxRate);
    void EnsureWidth(int Spc, int MinWidth, int MaxWidth);

    void PageUpdate();

    void ContentUpdate();

    void AddTitleTips(HWND hWnd);

    void UpdateLevelUpComponents(int SpecialCounter);

    DECLARE_MESSAGE_MAP()
public:
    afx_msg void OnDestroy();
    virtual BOOL PreTranslateMessage(MSG* pMsg);
};

#ifndef _DEBUG  // debug version in GrandiaX Mana Egg Table GeneratorView.cpp
inline CGrandiaXManaEggTableGeneratorDoc* CGrandiaXSpecialsView::GetDocument()
   { return (CGrandiaXManaEggTableGeneratorDoc*)m_pDocument; }
#endif